home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / js.zip / LF.JS < prev    next >
Text File  |  1992-12-30  |  1KB  |  38 lines

  1. NB.  This file can be used as a script input file to J Version 6.1
  2. NB.  December 1992
  3.  
  4. NB.  Donald B. McIntyre
  5. NB.  Luachmhor, 1 Church Road
  6. NB.  KINFAUNS, PERTH PH2 7LD
  7. NB.  SCOTLAND - U.K.
  8. NB.  Telephone:  In the UK:      0738-86-726
  9. NB.  From USA and Canada:   011-1-738-86-726
  10. NB.  email:  donald.mcintyre@almac.co.uk
  11.    
  12.    NB.   Using J with External Data:  Inserting Line Feeds
  13.    NB.   VECTOR Vol.8#4 (April 1992) 97-110
  14.    
  15. NB.  Reads four files:  tut10.in  tut11.in  tut12.in  tut13.in
  16. NB.  Writes corresponding files with extension .out
  17.       read=. 1!:1@<
  18.       lf=. 10{a. [  nl=. 13{a.
  19.  
  20.       ]x=. read 'tut11.in'
  21.       +/ x =/ 13 10 { a.
  22.  
  23.       h=. <;.2~ =&nl        NB.  Hook
  24.       each=. &.>
  25.       g=. ,&lf each
  26.       edit=. ; @ (g @ h)
  27.       input=. edit @ read
  28.       input=. input f.
  29.  
  30.       infiles=. 'tut10.in';'tut11.in';'tut12.in';'tut13.in'
  31.       outfiles=. 'tut10.out';'tut11.out';'tut12.out';'tut13.out'
  32.  
  33.       output=. 1!:2~ >               NB.   Hook
  34.       outfiles output"0 input each infiles
  35.  
  36.       read 'tut11.in'
  37.       read 'tut11.out'
  38.